# -*- coding: utf-8  -*-
# @File     : attendanceManagementPageCase_test.py
# @author   : Jerry
# @datetime : 2022/3/19 15:36
# @software : PyCharm
from pages.attendanceManagementPage import AttendanceManagementPageActionObj as AMPA

import pytest

class TestAttendanceManagenmentPageCase:
    def test_PunchClock(self):
        """
        测试打卡功能，打卡成功后，考勤表会多出来一条记录
        :return:
        """

        AMPA.to_page()

        """1 获取打卡之前的考勤表的考勤数量"""
        beforeNum = len(AMPA.sign_table_tr_boxes())

        """2 点击打卡按钮"""
        AMPA.punch_Clock()

        """3 重新加载考勤表"""
        AMPA.driver.refresh()

        """4 获取打卡之后的考勤表的考勤数量"""
        afterNum = len(AMPA.sign_table_tr_boxes())

        assert afterNum - 1 == beforeNum


if __name__ == '__main__':
    pytest.main()

























